package com.example.demo.service;

import com.example.demo.mapper.ReserveMapper;
import com.example.demo.model.Response;
import com.example.demo.model.entity.ReserveNumber;
import com.example.demo.model.entity.User;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class ReserveService {

    @Resource
    ReserveMapper reserveMapper;

    public void takeNumber(User user) {
        reserveMapper.newNumber(user);
    }

    public void deleteNumber(User user) {
        reserveMapper.deleteNumber(user);
    }

    public ReserveNumber nextNumber() {
        // TODO: 出队
        return reserveMapper.nextNumber();
    }

    public ReserveNumber numberNow() {
        // TODO: 当前号码
        return reserveMapper.numberNow();
    }
}
